Click here to return to the VHDL Reference Guide. (last edit: 24. september 2012)

Exit

A sequential statement which jumps straight out of a loop.

Syntax

  [Label:] exit [LoopLabel] [when Condition];
    

Where

loop--end loop See Sequential Statement

Rules

The exit must be inside a loop with the given LoopLabel, or inside any loop if there is no LoopLabel.

Example

  L1: loop
    L2: for I in A'RANGE loop
      if A(I) = 'U' then
        exit L1;                              -- Leave outer loop L1
      end if;
      exit when I = N;                        -- Leave inner loop L2
    end loop L2;
    ...
  end loop L1;
    

See Also

Next, For Loop, While Loop, Loop